/**
 * @file vision.h
 * @author yanshuoyu
 * @brief  接受视觉数据并经过pid计算处理得出yaw轴转动值和pitch轴转动值，并由视觉控制开火以及单发和连发
 * @version beta
 * @date 2024-10-21
 *
 *
 */

#ifndef VISION_H
#define VISION_H

#include "controller.h"
#include "stdint.h"
#include "master_process.h"
#include "stdbool.h"

// RX_PACKET* rxpack;
// PIDInstance vision_PID;

// typedef struct
// {
//     PIDInstance vision_PID;
//     float pid_ref; // 将会作为每个环的输入和输出顺次通过串级闭环
// } vision_Controller_s;

typedef struct {
    float pitch;
    float yaw;
} VisionAngle;

typedef struct {
    float pid_ref_y;
    float pid_ref_p;
} PIDRefs;

extern uint8_t vision_fire_flag;
void GetVision(float yaw, float pitch);
void GetMeasure(float yaw, float pitch);
void GetVision_data(float yaw, float pitch);
void vision_to_init();
PIDRefs vision_to_control();


#endif //VISION_H

